﻿using System;
using SQLite4Unity3d;
using UI.Dates;

namespace TodoList.TodoTask
{
    public class TodoTaskTable
    {
        //设置主键 自动增长
        [PrimaryKey, AutoIncrement]
        public int    Id            { get; set; }
        public string Name          { get; set; }
        public string  Description  { get; set; }
        public DateTime  Deadline   { get; set; }
        public bool  IsDone         { get; set; }

        public TodoTaskTable()
        {
        }
        
        public TodoTaskTable(string name, string description, DateTime deadline)
        {
            Name = name;
            Description = description;
            Deadline = deadline;
        }
        
        /// <summary>
        /// 重写 ToString 函数，方便控制台打印
        /// </summary>
        public override string ToString() 
            => $"[Id: {Id}, Task: Name={Name},  Description={Description}, Deadline={Deadline.ToDateString()}], IsDone={IsDone}]";
        
    }
}